<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>仓储物资智能管理跟踪系统</title><!-- 编辑 -->
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
<meta http-equiv="description" content="this is my page"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<script type="text/javascript" src="../../head.js"></script>
</head>
	<body>
		<div id="tools" class="datagrid-toolbar">
			<a onclick="save();" class="easyui-linkbutton" iconCls="icon-save" plain="true">保存</a>
			<a onclick="closeWindow();" class="easyui-linkbutton" iconCls="icon-close" plain="true">关闭</a>
	    </div>
		<form id="myForm" name="myForm" method="post" style="margin-top: 20px;">
			<p id="errorMsg" style="color:red;margin-top:5px;"></p>
			<table class="formTable" >
				<tr>
					<td class="tdc1">
						知识名称：
					</td>
					<td align="left">
						<input type="text" name="knowledgename"  id="knowledgename" class="easyui-validatebox" maxlength="100"/>
					</td>
					
				</tr>
					
				<tr>
					<td class="pn-flabel pn-flabel-h">知识图片:</td>
	    			<td class="pn-fcontent">
	    				<input type="file" id="collegeimage"style="width:180px;"  name="collegeimage"  
	    			    style="width:150px;" 
	    			    	onchange="uploadFile();"/><br />
	    			<span style="color: red;">* 建议280*280</span>
	    			</td>
				</tr>
				<tr>
				<td class="tdc1">
					知识课时：
				</td>
				<td>
					<input type="text" name="knowledgenum" id="knowledgenum" data-options="required:true,min:0,precision:0"  class="easyui-numberbox" />
				</td>
				
				<td class="tdc1">
					知识时长(时长)：
				</td>
				<td>
					<input type="text" name="knowledgetimelong" id="knowledgetimelong" class="easyui-validatebox" data-options="required:true" maxlength="100" />
					
				</td>
			   </tr>
			   
			   <tr>
				<td class="tdc1">
					原价：
				</td>
				<td>
					<input type="text" name="knowledgeinitprice" id="knowledgeinitprice" data-options="required:true,min:0,precision:0"  class="easyui-numberbox" />
				</td>
				
				<td class="tdc1">
					VIP价格：
				</td>
				<td>
					<input type="text" name="knowledgevipprice" id="knowledgevipprice" data-options="required:true,min:0,precision:0"  class="easyui-numberbox" />
				</td>
			   </tr>
			   
			   <tr>
			   <td class="tdc1">
					是否收费：
				</td>
				<td>
					<select id="knowledgeifprice" name="knowledgeifprice">
						<option value="1">不收费</option>
						<option value="2">收费</option>
					</select>
				</td>
			   </tr>
			   
			   <tr>
				<td class="tdc1">
					备注：
				</td>
				<td>
					<textarea id="remark" name="remark"></textarea>
				</td>
			   </tr>
			</table>
			<input type="hidden" name="parentObjId" id="parentObjId" />
			<input type="hidden" name="depth" id="depth" />
			<input type="hidden" name="status" id="status" value="1" />		
		</form>
	</body>
</html>
<script>

	var id = getPram('id');
	var view = new FormView('#myForm',contextPath+'/system/getKnowledgeCourseById/'+id);
	view.doLoad(loadParent);
	function loadParent(model) {
		
	}
	function checkFormMe(){
	   return $('#myForm').form('validate');
	}
	//保存
	function save(){
		if(checkFormMe()){
			var arg = $('#myForm').serializeArray();
			jQuery.post(contextPath+"/system/eidtKnowledgeCourse/"+id,arg,
			function (data) {
				var res =$.parseJSON(data.toString());
				if(res['flag'] == "success"){
					$.messager.alert("提示","操作成功!",'info',function(rt){
						window.parent.updateSearch();
						closeWindow();
					});
				}else if(res['flag'] == "error"){
					$.messager.alert("提示",res['message'],'warning');
				}else{
					$.messager.alert("提示","操作失败!",'error');
				}
			});
		}
	}
</script>